﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace DS_Server
{
    public class pList : ArrayList
    {
        public void Create(string path, Person person)
        {
            dsFactory.getInstance(path).Create(person);
        }

        public void Read(string path)
        {
            this.Clear();
            this.AddRange(dsFactory.getInstance(path).Read());
        }

        public void Update(string path, int id, string fname, string lname, int age)
        {
            dsFactory.getInstance(path).Update(id, fname, lname, age);
        }

        public void Delete(string path, int id)
        {
            dsFactory.getInstance(path).Delete(id);
        }

        public bool compare(pList init)
        {
            bool ret = false;

            //if (this.Count == init.Count)
            //{
            //    while (this.ds != null)
            //    {
            //        if (this.ds == init.ds)
            //        {
            //            this.ds = this.ds.Next;
            //            init.ds = init.ds.Next;
            //            ret = true;
            //        }
            //        else
            //        {
            //            ret = false;
            //            break;
            //        }
            //    }
            //}

            return ret;
        }
    }
}
